
/**
 * 用户可用菜单列表
 */
interface MenuListItemResponse {
    name: string,
    menu_child: Array<MenuChildListResponse>
}

interface MenuChildListResponse {
    name: string
}

interface IMenuService {
    /**
     * 获取用户可用菜单
     */
    getMenu(): ng.IHttpPromise<ListResponse<MenuListItemResponse>>;
}

class menuService implements IMenuService {
    constructor(private http: ng.IHttpService, private route: routeService) {
    }
    getMenu(): ng.IHttpPromise<ListResponse<MenuListItemResponse>> {
        return this.http<ListResponse<MenuListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("menu", {
            })
        });
    }
}

angular.module("menuService", []).service("menuService", ['$http', 'routeService', menuService]);